<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
       div {
            width: 500px;
            height: 40px;
           margin-top: 50px;
            margin: 0 auto;


        }
        #menhu {
            margin-top: 40px;
            padding: 5px;
        }
        img {
            vertical-align: center;
        }
     .serc {
         float: left;
     }
        .tijiao {
            height: 20px;

        }

    </style>

    <script>
        function tihuang() {

            var a=document.getElementsByName("choose");
            var c;
            for( c of a){
                if(c.checked){
                    break;
                }
            }
                if (c.value=="taobao"){
                    var b= document.getElementById("tupian").src="taobao_shopping-446.png";
                    document.getElementById("menhu").action="https://s.taobao.com/search";
                    document.getElementById("sousuo").name="q";


                } else if(c.value=="baidu"){
                    var b= document.getElementById("tupian").src="baidu_web.png";
                    document.getElementById("menhu").action="https://www.baidu.com/s";
                    document.getElementById("sousuo").name="wd";
                }else if (c.value=="guge"){
                    var b= document.getElementById("tupian").src="google_web-444.png";
                    document.getElementById("menhu").action="https://www.google.com/search";
                    document.getElementById("sousuo").name="q";
                }
        }
        // function tihuang1() {
        //
        //     var b= document.getElementById("tupian").src="google_web-444.png";
        //     document.getElementById("menhu").action="https://www.google.com/search";
        //     document.getElementById("sousuo").name="q";
        // }
        // function tihuang2() {
        //
        //     var b= document.getElementById("tupian").src="taobao_shopping-446.png";
        //     document.getElementById("menhu").action="https://s.taobao.com/search";
        //     document.getElementById("sousuo").name="q";
        // }
        </script>
</head>
<body>
<div id="lunbo">
    <img id="tupian" class="serc" src="taobao_shopping-446.png" height="30" width="86"/>
    <form action="https://s.taobao.com/search" id="menhu" >
        <input type="text" class="serc tijiao"  name="q" id="sousuo">
        <input type="submit" class="serc tijiao"  value="搜索">
    </form>
</div>

<div>
    <input id="taobao" name="choose" value="taobao" type="radio" checked  onclick="tihuang()">淘宝
    <input id="baidu" name="choose" value="baidu" type="radio" onclick="tihuang()" >百度
    <input id="guge" name="choose" value="guge" type="radio" onclick="tihuang()">谷歌

</div>

</body>
</html>